﻿@{
    ViewBag.Title = "Ins";
}
@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js?ver=GetDate()")" type="text/javascript"></script>  
    <script src="@Url.Content("~/Scripts/common/gridlayout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common/export.js")" type="text/javascript"></script>
}
<body>
   <form id="form1" runat="server" method="post" style="height: 100%">
    
    @Html.Partial("~/Views/Modular/ReportsToolbar.cshtml")
    
    <div id = "DivHeader">
        <table>
            <tr>
                <td width ="70px" align="right">门店名称：</td>
                <td width ="200px">    
                    @Html.Partial("~/Views/Modular/LookupStockInfo.cshtml")                      
                </td>
                <td width ="70px" align="right">商品品牌：</td>
                <td width ="200px">    
                    @Html.Partial("~/Views/Modular/LookupGoodsBrand.cshtml")                      
                </td>
                <td width ="70px" align="right">结存状态：</td>
                <td width ="150px">
                    <input id="comflag" name="comflag" class="mini-combobox" style="width:150px;" 
                           showNullItem="false" allowInput="false" value="0"  align="left" data ="checkflag"/>
                </td>
            </tr>
            <tr>
                <td width ="70px" align="right">商品分类：</td>
                <td width ="200px">       
                    @Html.Partial("~/Views/Modular/LookupGoodsClass.cshtml")
                </td>
                <td width="70px" height="30px" align="right">主供应商：</td>
                <td width="200px" height="30px">
                    @Html.Partial("~/Views/Modular/LookUpSupply.cshtml")
                </td>
                <td width ="70px" align="right">商品搜索：</td>
                <td width ="150px">
                    <input name="FNumber" class="mini-textbox" style="width:150px;margin-left:1px;"/>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" borderStyle="border:1;" pageSize="15"
            url="../Report/GetCommonReport" allowCellSelect="true" showSummaryRow="false" sortMode="client">
            <div property="columns">
                <div field="FNumber" width="90" headerAlign="center">商品编码</div>
                <div field="FName" width="130" headerAlign="center">商品名称</div>
                <div field="FSpec" width="80" headerAlign="center">规格型号</div>
                <div field="FUnitName" width="40" headerAlign="center">单位</div>
                <div field="FQty" name="FQty" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">数量</div>
                <div field="FPrice" name="FPrice" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">库存单价</div>
                <div field="FAmount" name="FAmount" width="90" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">库存金额</div>
                <div field="FPurPrice" name="FPurPrice" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">进货单价</div>
                <div field="FPurAmount" name="FPurAmount" width="90" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">进货金额</div>
                <div field="FPosPrice" name="FPosPrice" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">零售单价</div>
                <div field="FPosAmount" name="FPosAmount" width="90" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">零售金额</div>
                <div field="FSelPrice" name="FSelPrice" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">批发单价</div>
                <div field="FSelAmount" name="FSelAmount" width="90" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">批发金额</div>
                <div field="FLowLimit" name="FLowLimit" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">库存下限</div>
                <div field="FHightLimit" name="FHightLimit" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">库存上限</div>                
                <div field="FTemporaryQty" name="FTemporaryQty" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">寄存数量</div>
                <div field="FTotalQty" name="FTotalQty" width="70" dataType="float" headerAlign="center"align="right"numberFormat="#,0.00" allowSort="true">合计库存</div>
                <div field="FCode" width="130" headerAlign="center">商品条码</div>
                <div field="FClassName" width="120" headerAlign="center">分类名称</div>
                <div field="FBrandName" width="120" headerAlign="center">商品品牌</div>
                <div field="FStockNumber" width="80" headerAlign="center">门店编码</div>
                <div field="FStockName" width="120" headerAlign="center">门店名称</div>
                <div field="FSuppNumber" width="80" headerAlign="center">供应商编码</div>
                <div field="FSuppName" width="120" headerAlign="center">供应商名称</div>
                <div field="FCorpNumber" width="80" headerAlign="center">商户编码</div>
                <div field="FCorpName" width="120" headerAlign="center">商户名称</div>
            </div>
        </div>  
    </div>
    
    <script type="text/javascript">
        var checkflag = [{ "id": "0", "text": "全部" },
                         { "id": "1", "text": "等于零" },{ "id": "2", "text": "大于零" },
                         { "id": "3", "text": "小于零" }, { "id": "4", "text": "寄存大于零" }]

        mini.parse();
        var form = new mini.Form("form1");
        var grid = mini.get("datagrid1");
        var uID = parent.window.getSystemAppID();
        var sumFields = "";

        function FormShown() {
            LoadData();
            InitGrid('RptStockTotal');
        }

        function clearloca() {
            mini.getbyName("FStockID").setValue("");
            mini.getbyName("FStockID").setText("");
            mini.getbyName("FStockName").setValue("");
            mini.getbyName("FClassNumber").setValue("");
            mini.getbyName("FClassNumber").setText("");
            mini.getbyName("FGoodsClassName").setValue("");
            mini.getbyName("FBrandItemID").setValue("");
            mini.getbyName("FBrandItemID").setText("");
            mini.getbyName("FBrandName").setValue("");
            mini.getbyName("FNumber").setValue("");
            mini.getbyName("FSupplyItemID").setValue("");
            mini.getbyName("FSupplyItemID").setText("");
            mini.getbyName("FSupplyName").setValue("");
        }

        function LoadData() {
            var mStockID = mini.getbyName("FStockID").getValue();
            var mClassID = mini.getbyName("FClassNumber").getValue();
            var mBrandID = mini.getbyName("FBrandItemID").getValue();
            var mNumber = mini.getbyName("FNumber").getValue();
            var mDataType = mini.getbyName("comflag").getValue();
            var mSupplyID = mini.getbyName("FSupplyItemID").getValue();

            var json = "[{";
            json = json + '"mReportType":' + '"4001",';//列表类型
            json = json + '"mSystemAppID":' + '"' + uID + '",';
            json = json + '"mStockID":' + '"' + mStockID + '",';
            json = json + '"mClassID":' + '"' + mClassID + '",';
            json = json + '"mBrandID":' + '"' + mBrandID + '",';
            json = json + '"mSupplyID":' + '"' + mSupplyID + '",';
            json = json + '"mDataType":' + '"' + mDataType + '",';
            json = json + '"mNumber":' + '"' + mNumber + '"';
            json = json + "}]";

            grid.load({ mydata: json });

            mExportDataUrl = grid.url;
            mExportDataJson = json;//导出
        }

        function printdata() {
            var url = "../Report/PrintReport";
            mini.open({
                url: url,
                title: "打印", width: 1000, height: 700,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var NoneDisplayCol = [0];
                    var head = "商品库存情况"
                    iframe.contentWindow.InitalPrint(grid, NoneDisplayCol, parent.window.getSystemCompany() + head);
                }
            });
        }

    </script>

    </form>
</body>